package com.gitee.chili.leisure.util;

import java.util.TimerTask;

/**
 * DefaultTimerTask
 *
 * @author week solider
 * @since 2020.09.11
 */
public class DefaultTimerTask extends TimerTask {


    /** 任务需要执行的函数 */
    private final Function function;


    public DefaultTimerTask(Function function) {
        this.function = function;
    }

    @Override
    public void run() {
        function.apply();
    }
}
